home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Taifun / Taifun 099 (1989-05-15)(Ossowski, Stefan)(DE)(PD).zip / Taifun 099 (1989-05-15)(Ossowski, Stefan)(DE)(PD).adf / PCQ / Runtime / writearb.asm < prev    next >
Assembly Source File  |  1989-03-31  |  796b  |  46 lines

  1.  
  2. *    WriteArb.asm (of PCQ Pascal runtime library)
  3. *    Copyright (c) 1989 Patrick Quaid
  4.  
  5. *    This just writes some type to a file of that type
  6.  
  7.     SECTION    ONE
  8.  
  9.     XREF    _p%DOSBase
  10.     XREF    _LVOWrite
  11.     XREF    outbuffer
  12.  
  13.     XDEF    _p%writearb
  14. _p%writearb
  15.  
  16.     cmp.l    #4,d3
  17.     ble.s    1$        ; if <= 4 then go around
  18.     move.l    d0,d2
  19.     bra.s    5$        ; go to write stuff
  20.  
  21. 1$    cmp.l    #3,d3        ; if its three, do the same
  22.     bne.s    2$
  23.     move.l    d0,d2
  24.     bra.s    5$
  25.  
  26. 2$    move.l    #outbuffer,d2    ; all these will write into buffer
  27.     cmp.l    #1,d3
  28.     bne.s    3$        ; if not 1 then go around
  29.     move.b    d0,outbuffer    ; move it into outbuffer
  30.     bra.s    5$        ; go write
  31.  
  32. 3$    cmp.l    #2,d3        ; is it two?
  33.     bne.s    4$        ; go around
  34.     move.w    d0,outbuffer    ; store it
  35.     bra.s    5$
  36.  
  37. 4$    move.l    d0,outbuffer    ; store it if it's 4
  38.  
  39. 5$    move.l    4(sp),d1
  40.     move.l    _p%DOSBase,a6
  41.     jsr    _LVOWrite(a6)
  42.     rts
  43.  
  44.     END
  45.  
  46.